!function(){
    $('.zz').on('click',function() {
    $.ajax({
        type:'post',
        url:'http://localhost/Yoho/php/longin.php',
        data:{
            user:$('username').val(),
            pass:hex_sha1($('.possword').val())
        }
    }).done(function (result) {
        if(result){
            location.href="1.html";
            localStorage.setItem('username',$('username').val());
        }else{
            $('.password').val();
            alert('用户名或者密码错误');
        }
    }) 
    })
}(jQuery)